//
// Created by tacom on 22-9-1.
//

#include "Python.h"

int main(int argc, char* argv[]){
    Py_SetPythonHome((wchar_t *)L"/home/tacom/anaconda3/envs/segmentation");

    wchar_t *program = Py_DecodeLocale(argv[0], NULL);
    if(program == NULL){
        fprintf(stderr, "cannnot decode argv[0]");
        exit(1);
    }

    Py_SetProgramName(program);
    Py_Initialize();

    PyRun_SimpleString("from time import time,ctime\n"
                       "print('Today is', ctime(time()))\n");

    if (Py_FinalizeEx() < 0){
        exit(120);
    }
    PyMem_Free(program);
    getchar();
    return 0;
}